<template>
	<view class="apply-withdrawal">
		<view class="option   center">
			<view class="txt">姓名:</view>
			<input class="input-class" v-model="real_name" placeholder="请填写您的姓名" placeholder-class="plc-hint" />
		</view>
		<view class="option   center">
			<view class="txt">账号:</view>
			<input class="input-class" v-model="account" placeholder="请填写您的账号" placeholder-class="plc-hint" />
		</view>
		<view class="option   center">
			<view class="txt">提现金额:</view>
			<input class="input-class" v-model="money" placeholder="请输入提现金额" placeholder-class="plc-hint" />
		</view>

		<view class="btn" @tap="submit">提现</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				money: '',
				account: '',
				real_name: '',
			}
		},
		methods: {
			submit() {
				if (!this.real_name) {
					return this.$tools.showMsg('请输入姓名')
				}
				if (!this.account) {
					return this.$tools.showMsg('请填写您的账号')
				}
				if (!this.money) {
					return this.$tools.showMsg('请输入提现金额')
				}


				let data = {
					money: this.money*100,
					account_number: this.account,
					real_name: this.real_name,
					token: this.$tools.getToken()
				}
				this.$http('common.horsemanRequestWithdrawal', {
					...data
				}).then(res => { 
					let result = res
					this.$tools.showMsg(res.msg)
					if (res.code == 200) {

						setTimeout(() => {
							uni.navigateBack()
						}, 600)
					}

				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.apply-withdrawal {
		padding: 0 24rpx;

		.option {
			border-bottom: 2rpx solid #f5f5f5;
			padding: 24rpx 0;

			.txt {
				flex: none;
			}

			.input-class {
				flex: auto;
				margin-left: 24rpx;
				font-size: 28rpx;
			}
		}

		.plc-hint {
			font-size: 28rpx;
		}

		.hint-class {
			font-size: 28rpx;
			color: #999;
			margin-top: 25rpx;
		}

		.btn {
			background: linear-gradient(128.5deg, #fae568 0%, #ffc82f 100%), linear-gradient(135.25deg, #f8dc59 0%, #f6bc57 100%), #cccccc;
			font-size: 32rpx;
			width: 690rpx;
			height: 90rpx;
			text-align: center;
			border-radius: 50rpx;
			line-height: 90rpx;
			margin: 64rpx auto;
		}
	}
</style>